package enums;

import java.util.EnumSet;

enum Bit {
    B1, B2, B3, B4, B5, B6, B7, B8
}

public class EnumSetDemo {
    public static void main(String[] args) {
        EnumSet<Bit> bits = EnumSet.noneOf(Bit.class);
        System.out.println(bits);

        bits.add(Bit.B3);
        bits.add(Bit.B5);
        System.out.println(bits);

        System.out.println(bits.contains(Bit.B2));
        System.out.println(bits.contains(Bit.B3));
    }
}
